/*
 * @Author: wangjun haodreams@163.com
 * @Date: 2024-11-06 23:35:14
 * @LastEditors: wangjun haodreams@163.com
 * @LastEditTime: 2025-06-11 16:44:17
 * @FilePath: \golib\easyjs\iconv.go
 * @Description: 数据转换
 */
package easyjs

import (
	"unicode/utf8"

	"gitee.com/haodreams/golib/charset"
)

// 数据转换
type Iconv struct {
}

// GBK 转 UTF8 编码
func (m *Iconv) UTF8(text string) string {
	return charset.UTF8(text)
}

// UTF8 转 GBK 编码
func (m *Iconv) GBK(text string) string {
	return charset.GBK(text)
}

func (m *Iconv) IsUTF8(text string) bool {
	return utf8.ValidString(text)
}
